package enums;

public enum ResponseErrorCode {
    UNKNOWN_ERROR(400, "未知错误"),

    ILLEGAL_USERNAME(501, "用户名必须在6~20个字符之间"),
    ILLEGAL_PASSWORD(502, "密码必须在6~20个字符之间"),
    USERNAME_ALREADY_USED(503, "用户名已被使用"),
    LOGIN_ERROR(504, "用户名或密码错误"),
    USER_NOT_EXISTED(505, "用户不存在"),

    ALREADY_FRIENDS(601, "已经是好友关系"),
    ALREADY_REJECTED(602, "已经被对方拒绝"),
    FRIEND_REQUEST_EXPIRE(603, "好友请求已过期"),

    GROUP_RELATION_NOT_EXISTED(701, "该用户不是群成员"),
    GROUP_RELATION_ALREADY_EXISTED(702, "该用户已经为是群成员"),
    GROUP_NOT_EXISTED(703, "群不存在");

    private final int code;
    private final String message;

    ResponseErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
